f = lambda x: 2 * x * x - 1
n, c = input().split()
n = int(n)
step = [int(2 * i - 1) for index, i in enumerate(range(n + 1)) if index != 0 and 0 <= f(i) <= n]
for index, i in enumerate(step[::-1]):
    print(' ' * index + i * c)
for index, i in zip(range(len(step) - 2, -1, -1), step[1:]):
    print(' ' * index + i * c)
print(max(0, n - f(len(step))))
